from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

driver = webdriver.Edge()
driver.get('https://www.douban.com/')
driver.maximize_window()
sleep(2)
driver.switch_to.frame(driver.find_element(By.XPATH,'//*[@id="anony-reg-new"]/div/div[1]/iframe'))
# 点击密码登录
driver.find_element(By.XPATH,'/html/body/div[1]/div[1]/ul[1]/li[2]').click()
sleep(2)
# 输入手机号密码
driver.find_element(By.ID,'username').send_keys('18238680385')
sleep(1)
driver.find_element(By.ID,'password').send_keys('Wjy2166135035')
sleep(1)
# 点击登录
driver.find_element(By.XPATH,'/html/body/div[1]/div[2]/div[1]/div[5]/a').click()

sleep(5)
